import { resultPageSuccess } from './_util'

const domainList = Array.from({ length: 200 }, () => {
  return {
    id: '@id',
    domain: '@domain',
    user: '@name',
    group: '默认分组',
    record: '@natural(10,50)',
    created_at: '@datetime',
    updated_at: '@datetime',
    dns_addr: '@domain',
    ns_state: '@natural(0,1)',
    remark: '@csentence'
  }
})

const domainRecordList = Array.from({ length: 200 }, () => {
  return {
    id: '@id',
    host: 'www',
    type: '@natural(1,10)',
    value: '@ip',
    ttl: '@natural(10,30)',
    state: '@natural(0,1)',
    created_at: '@datetime',
    updated_at: '@datetime',
    remark: '@csentence'
  }
})

export default [
  {
    url: '/mock/domain/list',
    method: 'get',
    response() {
      return resultPageSuccess(0, 20, domainList)
    }
  },
  {
    url: '/mock/domain/record',
    method: 'get',
    response() {
      return resultPageSuccess(0, 20, domainRecordList)
    }
  }
]
